#include "stdafx.h"
#include "Queue.h"

Queue::Queue()
: m_head(-1)
{
}

void Queue::Insert(LONG first, LONG second)
{
	m_head = (m_head + 1) % ELEM_NUM;
	m_data[m_head][0] = first;
	m_data[m_head][1] = second;

}

int Queue::GetHead()
{
	return m_head;
}

LONG Queue::GetData(int n, int idx)
{
	if (n < 0 || n > ELEM_NUM || idx < 0 || idx > 1) {
	//	exit(0);
	}
	return m_data[n][idx];
}